package gt.actions;

import gt.service.UserService;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@WebServlet("/delAdmin")
public class delAdmin extends HttpServlet {

	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		    String id=req.getParameter("id");
		    System.out.println("oo"+id);
		    UserService userService =new  UserService();
		    boolean b=userService.delUser(id);
		    if(b){
		    	 req.getRequestDispatcher("systemset/delAdminOk.jsp").forward(req, resp);
		    }else{
		    	 req.getRequestDispatcher("systemset/delAdminError.jsp").forward(req, resp);
		    }
	}

	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		this.doGet(req, resp);
	}
	
	

}
